* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    max-width: 1100px;
    width: 100%;
    text-align: center;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.score-container {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.canvas-container {
    margin: 0 auto;
    width: 1000px;
    height: 1000px;
    max-width: 100%;
    overflow: auto;
}

#game-canvas {
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="1000" height="1000" viewBox="0 0 1000 1000"%3E%3Crect width="1000" height="1000" fill="%237EC850" /%3E%3Cg opacity="0.3"%3E%3Crect x="0" y="0" width="1000" height="1000" fill="url(%23grassPattern)" /%3E%3C/g%3E%3Cellipse cx="200" cy="800" rx="150" ry="100" fill="%233A8EBA" /%3E%3Cellipse cx="200" cy="800" rx="130" ry="85" fill="%235AADDA" /%3E%3Cpath d="M130,780 Q150,770 170,780 Q190,790 210,780 Q230,770 250,780" stroke="%237BCBF5" fill="none" stroke-width="2" /%3E%3Cpath d="M140,810 Q160,800 180,810 Q200,820 220,810 Q240,800 260,810" stroke="%237BCBF5" fill="none" stroke-width="2" /%3E%3Crect x="800" y="500" width="40" height="200" fill="%238B4513" /%3E%3Ccircle cx="820" cy="450" r="120" fill="%232E7D32" /%3E%3Ccircle cx="750" cy="400" r="80" fill="%232E7D32" /%3E%3Ccircle cx="880" cy="380" r="90" fill="%232E7D32" /%3E%3Ccircle cx="780" cy="420" r="15" fill="%23D32F2F" /%3E%3Ccircle cx="850" cy="380" r="15" fill="%23D32F2F" /%3E%3Ccircle cx="790" cy="350" r="15" fill="%23D32F2F" /%3E%3Ccircle cx="730" cy="380" r="15" fill="%23D32F2F" /%3E%3Ccircle cx="840" cy="450" r="15" fill="%23D32F2F" /%3E%3Cdefs%3E%3Cpattern id="grassPattern" width="30" height="30" patternUnits="userSpaceOnUse"%3E%3Cpath d="M0,15 L5,10 L10,15 L15,5 L20,15 L25,10 L30,15" stroke="%235DAE3F" fill="none" stroke-width="1" /%3E%3Cpath d="M0,25 L5,20 L10,25 L15,15 L20,25 L25,20 L30,25" stroke="%235DAE3F" fill="none" stroke-width="1" /%3E%3C/pattern%3E%3C/defs%3E%3C/svg%3E');
    background-size: cover;
    background-repeat: no-repeat;
    border: 2px solid #333;
}

.controls {
    margin: 20px 0;
}

.speed-controls {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    font-weight: bold;
}

.speed-controls span {
    margin: 0 5px;
}

#speed-display {
    display: inline-block;
    min-width: 30px;
    background-color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

#increase-speed-btn, #decrease-speed-btn {
    background-color: #FF9800;
    width: 35px;
    height: 35px;
    padding: 0;
    font-size: 1.2rem;
    font-weight: bold;
}

#increase-speed-btn:hover, #decrease-speed-btn:hover {
    background-color: #F57C00;
}

.mode-controls {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
}

.mode-controls label {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.mode-controls input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

.mode-controls .tooltip {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: normal;
    font-size: 0.9rem;
}

.mode-controls label:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

button {
    background-color: #4CAF50;
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    margin: 0 5px;
    padding: 10px 15px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

#pause-btn {
    background-color: #2196F3;
}

#pause-btn:hover {
    background-color: #0b7dda;
}

#restart-btn {
    background-color: #f44336;
}

#restart-btn:hover {
    background-color: #d32f2f;
}

.instructions {
    margin-top: 20px;
    text-align: left;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.instructions h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.instructions p {
    margin-bottom: 5px;
    color: #666;
}

@media (max-width: 1100px) {
    .canvas-container {
        width: 100%;
        height: auto;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
    }
    
    .controls button {
        margin-bottom: 10px;
    }
}